const app = getApp();
Page({
  data: {

  },
  onLoad: function () {
    var that = this;
    app.request('base/getRoutineSet', {
      
    }, 'POST', false, function (res) {
      that.setData({
        info:res.data
      })
    })
  },
  formSubmit: function (e) {
    app.getFormid(e);
  },
  getPhoneNumber: function (e) {
    let that = this;
    let session_key = wx.getStorageSync('session_key');
    let iv = encodeURIComponent(e.detail.iv);
    let encryptedData = encodeURIComponent(e.detail.encryptedData);
    app.request('common/getPhoneNumber', {
      session_key, iv, encryptedData
    }, 'POST', false, function (res) {
      if (res.data.code == 1) {
        wx.showToast({
          title: '授权成功！',
          icon: 'success'
        })
        wx.setStorageSync('getPhone', true)
        setTimeout(function () {
          wx.navigateBack({
            delta: 1,
          })
        })
      } else {
        wx.showToast({
          title: '授权失败！',
          icon: 'success'
        })
      }
    })
  },
  cancle: function () {
    var that = this;
    wx.navigateBack({
      delta: 1,
    })
  },
  onShareAppMessage: function () {

  }
})